package com.xc.h05.service.renMengBinService.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xc.h05.entity.ConsultlevelRMB;
import com.xc.h05.mapper.ConsultlevelRMBMapper;
import com.xc.h05.service.renMengBinService.ConsultlevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsultlevelRMBServiceImpl implements ConsultlevelService {
    @Autowired
    ConsultlevelRMBMapper consultlevelMapper;
    @Override
    public PageInfo<ConsultlevelRMB> selectAll(int pageNum, int pageSize, ConsultlevelRMB consultlevel) {
        PageHelper.startPage(pageNum, pageSize);
        List<ConsultlevelRMB> list = consultlevelMapper.selectAll(consultlevel);
        PageInfo<ConsultlevelRMB> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public int add(ConsultlevelRMB consultlevel) {
        int i = consultlevelMapper.insert(consultlevel);
        return i;
    }

    @Override
    public int remove(int id) {
        int i = consultlevelMapper.delete(id);
        return i;
    }

    @Override
    public int update(ConsultlevelRMB consultlevel) {
        int i = consultlevelMapper.update(consultlevel);
        return i;
    }
}
